*** Settings ***
Documentation    用户登录及发布话题
Library     SeleniumLibrary

*** test cases ***
用户登录成功
    Open Browser    http://39.107.96.138:3000/    Chrome
    Maximize Browser Window
    Set Selenium Implicit Wait    5
    Set Selenium Speed    0.3
    Click Element   //a[@href="/signin"]
    Input Text    //*[@id="name"]     mitty
    Input Text    //*[@id="pass"]    123456
    Click Element    //input[@type="submit"]
    Element Text Should Be    //span[@class="user_name"]/a[@class="dark"]    mitty

发布话题并删除
    Click Element    //*[@id="create_topic_btn"]/span
    Click Element    //*[@id="tab-value"]/option[3]
    Input Text    //textarea[@id="title"]    Mitty question
 #   Set Focus To Element    xpath://div[@class="CodeMirror-scroll"]
    Click Element    //pre
    Press Keys      //pre     Mitty question
    Press Keys      //pre     COMMAND+a
    Click Element      //a[@class="eicon-bold"]
    Click Element    //input[@value="提交"]
    ${mitty_topic_url}     Log Location
    Element Text Should Be    //span[@class="topic_full_title"]    Mitty question
  #  Close Window
    Click Element    //i[@title="删除"]
    Handle Alert    action=DISMISS
    Click Element    //i[@title="删除"]
    Handle Alert
    Go To    ${mitty_topic_url}
    Element Text Should Be  //strong    此话题或已被删除。